/***********************************************************************************************************************
 *  FILE DESCRIPTION
 *  ------------------------------------------------------------------------------------------------------------------*/
/** \file
 *  \brief        Implementation of the HIS security module
 *
 *  --------------------------------------------------------------------------------------------------------------------
 *  COPYRIGHT
 *  --------------------------------------------------------------------------------------------------------------------
 *  \par Copyright
 *  \verbatim
 *  Copyright (c) 2014 by Vector Informatik GmbH.                                                  All rights reserved.
 *
 *                This software is copyright protected and proprietary to Vector Informatik GmbH.
 *                Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
 *                All other rights remain with Vector Informatik GmbH.
 *  \endverbatim
 */
/**********************************************************************************************************************/

/***********************************************************************************************************************
 *  AUTHOR IDENTITY
 *  --------------------------------------------------------------------------------------------------------------------
 *  Name                          Initials      Company
 *  --------------------------------------------------------------------------------------------------------------------
 *  Joern Herwig                  JHg           Vector Informatik GmbH
 *  Markus Schneider              Mss           Vector Informatik GmbH
 *  --------------------------------------------------------------------------------------------------------------------
 *  REVISION HISTORY
 *  --------------------------------------------------------------------------------------------------------------------
 *  Version    Date        Author  Change Id        Description
 *  --------------------------------------------------------------------------------------------------------------------
 *  01.00.00   2013-06-20  JHg     ESCAN00068213    Initial release based on FblSecMod_Vector 02.02.00
 *  02.00.00   2013-10-01  JHg     ESCAN00070689    Major refactoring
 *                                                   Split into separate sub-packages
 *                                                   Renamed file name (was SecM.c)
 *                                                   Removed SecM_StateTask
 *  02.01.00   2013-11-08  JHg     ESCAN00071173    Added support for CRC, seed/key and verification APIs
 *  02.01.01   2013-11-08  JHg     ESCAN00071733    No changes
 *  02.01.02   2013-11-11  JHg     ESCAN00071785    No changes
 *  02.02.00   2013-12-19  Mss     ESCAN00072743    No changes 
 *  02.03.00   2014-02-20  JHg     ESCAN00073562    No changes
 *                         Mss     ESCAN00073600    No changes
 *                         Mss     ESCAN00073811    No changes
 **********************************************************************************************************************/

/***********************************************************************************************************************
 *  INCLUDES
 **********************************************************************************************************************/

/* Security module configuration settings */
#include "Sec_Inc.h"

/* Global definitions for security module */
#include "Sec_Types.h"

#include "Sec.h"

/***********************************************************************************************************************
 *   VERSION
 **********************************************************************************************************************/

#if ( SYSSERVICE_SECMODHIS_VERSION != 0x0203u ) || \
    ( SYSSERVICE_SECMODHIS_RELEASE_VERSION != 0x00u )
# error "Error in SecM.c: Source and header file are inconsistent!"
#endif

/**********************************************************************************************************************
 *  GLOBAL DATA
 *********************************************************************************************************************/


/**********************************************************************************************************************
 *  LOCAL FUNCTION PROTOTYPES
 *********************************************************************************************************************/

static void SecM_TimerTask( void );

/**********************************************************************************************************************
 *  LOCAL FUNCTIONS
 *********************************************************************************************************************/

/**********************************************************************************************************************
 *  SecM_TimerTask
 *********************************************************************************************************************/
/*! \brief         Handle all timer related task
 *  \details       Called with period of SEC_CALL_CYCLE ms
 *********************************************************************************************************************/
static void SecM_TimerTask( void )
{
   /* Count down key timer */
   SecM_DecrKeyTimer();
}

/**********************************************************************************************************************
 *  GLOBAL FUNCTIONS
 *********************************************************************************************************************/

/**********************************************************************************************************************
 *  SecM_InitPowerOn
 *********************************************************************************************************************/
/*! \brief         Initialize security module
 *  \param[in]     initParam Initialization parameters (unused - reserved for future use)
 *  \return        SECM_OK if initialization successful
 *                 SECM_NOT_OK otherwise
 *********************************************************************************************************************/
SecM_StatusType SecM_InitPowerOn( SecM_InitType initParam )
{
#if defined( V_ENABLE_USE_DUMMY_STATEMENT )
   /* Avoid compiler warnings */
   (void)initParam; /* PRQA S 3112 */ /* MD_Sec_3112 */
#endif /* V_ENABLE_USE_DUMMY_STATEMENT */

   return SECM_OK;
}

/**********************************************************************************************************************
 *  SecM_Task
 *********************************************************************************************************************/
/*! \brief         Cyclic task of security module
 *  \details       Called with period of SEC_CALL_CYCLE ms
 *********************************************************************************************************************/
void SecM_Task( void )
{
   SecM_TimerTask();
}

/**********************************************************************************************************************
 *  MISRA
 *********************************************************************************************************************/

/* Module specific MISRA deviations:

   MD_Sec_3112:
     Reason: Dummy statements have been added to avoid compiler warnings because of unused variables.
     Risk: Unused statements add to program complexity just by being there - adding lines to the program and causing
      readers to puzzle over its presence.
     Prevention: Dummy statements can be turned off externally (V_DISABLE_USE_DUMMY_STATEMENT).

*/

/***********************************************************************************************************************
 *  END OF FILE: SEC.C
 **********************************************************************************************************************/

